import request from '@/utils/request'

// 点赞或取消点赞
export function toggleLike(type, id) {
  return request({
    url: '/community/' + type + '/' + id + '/like',
    method: 'post'
  })
}

// 检查是否已点赞
export function checkLike(type, id) {
  return request({
    url: '/community/check-like/' + type + '/' + id,
    method: 'get'
  })
}

// 获取用户点赞列表
export function listLikes(query) {
  return request({
    url: '/community/likes',
    method: 'get',
    params: query
  })
} 